﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web.Enhancements.Rest;
using TestWeb25.Components.UserGui.Providers;
using System.Web.Compilation;
using System.Web.Util;

namespace TestWeb25
{
    public partial class WebTest2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //WebRestClient.RegisterJSClient(typeof(TestWeb25.Components.InfoPreviewHandler));

            //UserControl tmpCtrl = new System.Web.UI.UserControl();
            //Control ctrl = tmpCtrl.LoadControl("TestControl.ascx");
            //System.Text.StringBuilder sbr = new System.Text.StringBuilder();
            //System.IO.StringWriter twr = new System.IO.StringWriter(sbr);
            //Html32TextWriter writer = new Html32TextWriter(twr);
            //ctrl.RenderControl(writer);
            //writer.Flush();

            System.Text.StringBuilder sbr = new System.Text.StringBuilder();
            System.IO.StringWriter twr = new System.IO.StringWriter(sbr);
            Html32TextWriter writer = new Html32TextWriter(twr);
            Web.Enhancements.Rest.Templates.HtmlTemplateFactory.RenderTemplate("TestControl.ascx", writer, "Lenny");
            writer.Flush();

            this.Response.Write(sbr.ToString());


        }
    }
}